#coding=utf-8

require "aio/core"
require "json"


class Aio::Module::OutputStyle::CompareJson < Aio::Module::OutputStyle

	def initialize
		super({
			:author			=> "Elin",
			:description => "这个模块输出为json文件，用于和基准值比较。",
			:file_suffix => "js",
		})
	end

	def generate
		file = File.new(output_file, "w+")
		device_hash = {}
		each_devices_with_useful do |device_name, useful|
			device_hash[device_name] = useful
		end
		#puts device_hash.to_json
		file.puts device_hash.to_json
	end
end
